package cglib;

public class Client {

    public static void main(String[] args) {

        TeacherDao target = new TeacherDao();
        //获取代理对象
        TeacherDao proxyInstance = (TeacherDao) new ProxyFactory(target).getProxyInstance();

        //执行代理对象的方法，触发intercept方法，从而实现对目标对象的调用
        proxyInstance.teach();
        //System.out.println(proxyInstance.teach("Tom"));
    }


}
